<?php
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php echo $html->charset(); ?>
        <title>
            <?php __('O Mondo Redondo'); ?> -
            <?php echo $title_for_layout; ?>
        </title>
        <?php
        echo $html->meta('icon');

        echo $html->css(array('estilo','datePicker'));

        echo $javascript->link('jquery','jquery.hoverIntent.minified');

        echo $scripts_for_layout;
        ?>

        <script type="text/javascript">
            $(document).ready(function(){
                $("#menu li em").click(function() {
                    var hidden = $(this).parents("li").children("ul").is(":hidden");

                    $("#menu>ul>li>ul").hide()
                    $("#menu>ul>li>a").removeClass();

                    if (hidden) {
                        $(this)
                        .parents("li").children("ul").toggle()
                        .parents("li").children("a").addClass("zoneCur");
                    }
                });
            });
        </script>
    </head>
    <body>
        <div id="page-wrap">        
            <div id="header">
                <?php echo $html->image('logo_mondo2.png', array('alt'=> __('Mondo Redondo', true), 'border'=>"0")) ?>
                <div id="right-side">
                    <img src="img/usericon.jpg" alt="user icon" />&ensp;
                    <a href="#" class="first">User Name</a>&ensp;
                    <a href="#">Submit New</a>&ensp;
                    <a href="#">Logout</a> &emsp;
                    <form id="main-search">
                        <label for="search-field" id="search-field-label">Search</label>
                        <input type="text" tabindex="1" maxlength="255" id="search-field"/>
                        <input type="image" alt="Search" value="Search" src="img/search.png" id="search-button"/>
                    </form>
                    <?php
                    /*if(isset($logado)) echo ($logado)?
                            'Você está logado como '.$usuario.'. '.$html->link(__('(sair)', true), '/usuarios/logout'):
                            'Visitante ('.$html->link(__('entrar', true), '/usuarios/login').'|'.$html->link(__('registrar', true), '/').')';*/
                    ?>
                </div>
            </div>
        </div>
        <div id="menu">
            <ul>
                <li><?php echo $html->link(__('Início', true), '/'); ?></li>
                <li>
                    <?php echo $html->link(__('Mondanos', true), '/mondanos'); ?>
                    <ul>
                        <?php foreach($menuMondanos as $menu_mondano_id => $menu_mondano):?>
                        <li>
                                <?php echo $html->link(__($menu_mondano, true), '/mondanos/'.$menu_mondano_id); ?>
                        </li>
                        <?php endforeach ?>
                    </ul>
                </li>
                <li>
                    <?php echo $html->link(__('Seções', true), '/secoes'); ?>
                    <ul>
                        <?php foreach($menuSecoes as $menu_secao_id => $menu_secao):?>
                        <li>
                                <?php echo $html->link(__($menu_secao, true), '/secoes/'.$menu_secao_id); ?>
                        </li>
                        <?php endforeach ?>
                    </ul>
                </li>
                <?php
                if(isset($logado) && $logado) echo '<li>'.$html->link(__('Escrever', true), '/admin/textos/add').'</li>';
                ?>
            </ul>
        </div>
        <div id="container">

            <div id="content">
                <?php
                $session->flash();
                ?>

                <?php echo $content_for_layout; ?>

            </div>
        </div>
        <div id="footer">
            <?php echo $html->link(
            $html->image('logo_acg.png', array('alt'=> __("ACG - Desenvolvimento e Suporte de Sistemas", true), 'border'=>"0")),
            'http://www.acganyware.com.br/',
            array('target'=>'_blank'), null, false
            );
            ?>
        </div>
        <?php echo $cakeDebug; ?>
    </body>
</html>